main : main.c src/add.o src/sub.o lib/libcal.a include/add.h include/sub.h
	gcc main.c -l cal -L lib -I include -o main

src/add.o : src/add.c
	gcc -c src/add.c -I include -o src/add.o

src/sub.o : src/sub.c
	gcc -c src/sub.c -I include -o src/sub.o

lib/libcal.a : src/add.o src/sub.o
	ar rcs lib/libcal.a src/add.o
	ar rcs lib/libcal.a src/sub.o

.PHONY : clean
clean : 
	rm -rf ./src/*.o
	rm main
